#include "MainWindow.h"
#include "ui_mainwindow.h"
#include "BoostTCPClient.h"

MainWindow::MainWindow(QWidget* parent)
	: QMainWindow(parent)
	, ui(new Ui::MainWindow)
{

	ui->setupUi(this);
}

MainWindow::~MainWindow()
{
	if (tcp_client)
	{
		delete tcp_client;
		tcp_client = nullptr;
	}
}

void MainWindow::on_btn_connect_clicked()
{
	tcp_client = new TcpClient();
	tcp_client->ConnectToServer("127.0.0.1", 1234);
	tcp_client->sendData("Hello, server!\n");
}